<#ftl output_format="HTML" auto_esc=true>
<@h.commonHead title="微信菜单管理" keywords="开源,永久免费" description="springrain开源系统管理后台"/>
</head>
<script type="text/javascript">

function deleteWeixinMenu(){
	var id=jQuery("#id").val();
	if(!id||id==""){
		myalert("请选择你要删除的记录");
		return;
	}else{
		var _url="${ctx}/weixinmenu/delete?id="+id;
		var listurl="${ctx}/weixinmenu/list";
		mydelete(_url,listurl);
	}
}
</script>


	
<@h.commonPage/>
<!-- /.page-header -->

<div class="row">
    <div class="col-xs-12">
<div class="operate panel panel-default" style="height:65px;">
	<div class="panel-body">
		<div class="pull-left">
 <form class="form-horizontal" name="searchForm" id="searchForm" action="${ctx}/wechat/menu/list" role="form">
            <input type="hidden" name="pageIndex" id="pageIndex" value="${(returnDatas.page.pageIndex)!'1'}"/>
            <input type="hidden" name="sort" id="page_sort" value="${(returnDatas.page.sort)!'desc'}"/>
            <input type="hidden" name="order" id="page_order" value="${(returnDatas.page.order)!'id'}"/>
			<label for="search_state"><b>是否可用:</b></label> 
			 <select id="search_state" name="state" class="col-10" >
				<option value="是">是</option>
				<option value="否">否</option>
			</select>
			<a  href="javascript:springrain.commonSubmit('searchForm');"
				class="btn btn-purple btn-sm">
					查询 <i class="ace-icon fa fa-search icon-on-right bigger-10"></i>
				</a>

	</form>
		</div>
		<div class="pull-right">
			    <@shiro.hasPermission name="/pubInfo/list/export" >
				  <button onclick="myexport('searchForm','${ctx}/wechat/menu/list/export');" class="btn  btn-sm  btn-primary">
                      
                        导出
                    </button>
		    	</@shiro.hasPermission>
			    <@shiro.hasPermission name="/pubInfo/list/export" >
				  <button onclick="myhref('${ctx}/wechat/menu/update/pre');" class="btn  btn-sm  btn-primary">
                        添加
                    </button>
			    </@shiro.hasPermission>
			    <@shiro.hasPermission name="/pubInfo/list/export" >
			    |
				  <button onclick="deleteWeixinMenu();" class="btn btn-sm btn-danger">
                        删除
                    </button>
			    </@shiro.hasPermission>
			
		</div>
	</div>
</div>

   <div class="row">
            <div class="col-xs-12">
	            <!--start_export-->
                <table id="listDataTable" border="1" class="table table-striped table-bordered table-hover">
                    <!--end_no_export-->
                    <!--first_start_export-->
                    <thead>
                    <tr>
                        <!--first_start_no_export-->
                        <th class="center">
                            <label class="position-relative">
                                <input class="ace" type="checkbox">
                                <span class="lbl"></span>
                            </label>
                        </th>
                        <th>操作</th>
                        <!--first_end_no_export-->
						<th id="th_name" >名称</th>
						<th id="th_pid" >菜单级别</th>
						<th id="th_pidName" >父级菜单</th>
						<th id="th_href" >跳转地址</th>
                    </tr>
                    </thead>
                    <!--first_end_export-->

                    <!--start_export-->
                    <tbody>
           
				   <#if (returnDatas.data??)&&(returnDatas.data?size>0)>
					 <#list returnDatas.data as _data>
                            <!--start_no_export-->
                            <tr class="">
                                <td class="center">
                                    <label class="position-relative">
                                        <input name="check_li" value="${_data.id}" class="ace" type="checkbox">
                                        <span class="lbl"></span>
                                    </label>
                                </td>
                                <td>
                                    <div class="hidden-sm hidden-xs btn-group">
                                        <button class="btn btn-xs btn-info"
                                                onclick="myhref('${ctx}/wechat/menu/update/pre?id=${(_data.id)!''}');">
                                            <i class="ace-icon fa fa-pencil bigger-120"></i>
                                        </button>
                                        <button class="btn btn-xs btn-danger"
                                                onclick="mydelete('${ctx}/wechat/menu/delete?id=${(_data.id)!''}','${ctx}/wechat/menu/list');">
                                            <i class="ace-icon fa fa-trash-o bigger-120"></i>
                                        </button>
                                    </div>
                                    <div class="hidden-md hidden-lg">
                                        <div class="inline position-relative">
                                            <button class="btn btn-minier btn-primary dropdown-toggle"
                                                    data-toggle="dropdown" data-position="auto">
                                                <i class="ace-icon fa fa-cog icon-only bigger-110"></i>
                                            </button>
                                            <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
	                                          <li>
													<a  href="javascript:myhref('${ctx}/wechat/menu/look?id=${(_data.id)!''}');"  class="tooltip-info" data-rel="tooltip" title="View">
														<span class="blue">
															<i class="ace-icon fa fa-search-plus bigger-120"></i>
														</span>
													</a>
											  </li>	
                                                <li>
                                                    <a data-original-title="Edit"
                                                       href="javascript:myhref('${ctx}/wechat/menu/update/pre?id=${(_data.id)!''}');"
                                                       class="tooltip-success" data-rel="tooltip" title="">
																		<span class="green">
																			<i class="ace-icon fa fa-pencil-square-o bigger-120"></i>
																		</span>
                                                    </a>
                                                </li>
                                                <li>
                                                    <a data-original-title="Delete"
                                                       href="javascript:mydelete('${ctx}/wechat/menu/delete?id=${(_data.id)!''}','${ctx}/wechat/menu/list');"
                                                       class="tooltip-error" data-rel="tooltip" title="">
																		<span class="red">
																			<i class="ace-icon fa fa-trash-o bigger-120"></i>
																		</span>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </td>
                                <!--end_no_export-->

							<td >
								${(_data.name)!''}
							</td>
							<td >
								<#if _data.pid?? && _data.pid==''>
									一级菜单
								<#else>
									二级菜单
								</#if>
								
							</td>
							<td>
								${(_data.pname)!''}
							</td>
							<td >
								${(_data.href)!''}
							</td>
						</tr>
					</#list>
					 </#if>
                    </tbody>
                </table>
                <!--end_export-->
            </div>
            <!-- /.span -->
        </div>
        <#if returnDatas.page??>	
            <@h.pagetoolbar page=returnDatas.page formId='searchForm' />
         </#if>
    </div>
</div>
<@h.footer/>
<!-- /.main-container -->
